<?php
/*
 * [JINYUN!] (C)2001-2099 Jinyunweb.com
 * This is NOT a freeware, use is subject to license terms
 * $Id: 2017-12-13 03:39:35 apple $
*/
defined('BY_JYA') or exit('error');
$_RQ['op']=$_RQ['op']?$_RQ['op']:'get';
cfc('core')->checklogin();
if($_RQ['op']=='get'){
	$return['item']=model('core/member')->detail($_SESSION['uid'],array('credit1','credit2','mobile','groupid','avatar','nickname'));
	$return['user']=pdo_get('jy_baobiao_project_cuser',array('id'=>$this->user_id,'uniacid'=>$_SESSION['uniacid']));
	$params=array('uniacid'=>$_SESSION['uniacid'],'user_id'=>$this->user_id);
	$data['allnum']=pdo_count('jy_baobiao_project',$params,'id');
	$params['status']=7;
	$data['weinum']=pdo_count('jy_baobiao_project',$params,'id');
	$return['data']=$data;
	$return['project_status']=array(
		0=>'待审核',
		1=>'初审合格',
		3=>'总评审通过',
		4=>'已添加协议待复审',
		5=>'协议复审通过',
		8=>'总评审不通过',
		9=>'协议复审不通过',
		10=>'初审不通过',
	);
	$return['params']['status']=0;
	set_html('title','项目中心');
	exi($return);
}
if($_RQ['op']=='status1'){
	$postdata=get_postdata();
	$id=intval($postdata['id']);
	pdo_update('jy_baobiao_project',array('status'=>1),array('id'=>$id,'workerid'=>$this->worker_id));
	exi('审核成功！');
}
if($_RQ['op']=='status4'){
	$postdata=get_postdata();
	$id=intval($postdata['id']);
	pdo_update('jy_baobiao_project',array('status'=>4),array('id'=>$id,'workerid'=>$this->worker_id));
	exi('退回课程成功！');
}
if($_RQ['op']=='status3'){
	$postdata=get_postdata();
	$id=intval($postdata['id']);
	pdo_update('jy_baobiao_project',array('status'=>3),array('id'=>$id,'workerid'=>$this->worker_id));
	exi('完成课程！');
}
if($_RQ['op']=='tingnum'){
	$postdata=get_postdata();
	$id=intval($postdata['id']);
	pdo_update('jy_baobiao_project',array('tingnum'=>$postdata['tingnum']),array('id'=>$id,'workerid'=>$this->worker_id));
	exi('更新成功！');
}
if($_RQ['op']=='setimg'){
	$postdata=get_postdata();
	$id=intval($postdata['id']);
	pdo_update('jy_baobiao_project',array('images'=>ijson_encode($postdata['images'])),array('id'=>$id,'workerid'=>$this->worker_id));
	exi('更新成功！');
}